package com.cyam.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public abstract class TimeUtil {

	private static final String FORMT_YYYY_MM_DD = "yyyy-MM-dd";
	
	/**
	 * 返回当前日期的前两个月的日期
	 * @return
	 */
	public static String currentOldTwoMonth() {
		SimpleDateFormat sdf = new SimpleDateFormat(FORMT_YYYY_MM_DD);
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(new Date());
		calendar.add(Calendar.MONTH, -2);
		return sdf.format(calendar.getTime());
	}
	
	public static void main(String[] args) {
		System.out.println(currentOldTwoMonth());
	}
}
